#include <string.h>
#include <jni.h>

#include "../../Library/ushare-1.1a/src/ushare_func.h"

jint
Java_com_willren_usharejni_UshareJni_startServer ( JNIEnv* env,
                                                  jobject thiz,
	jstring iface_name, jstring server_name, jstring content_dir )
{
	jint ret = 0;
	
	const char * sz_iface_name = (*env)->GetStringUTFChars(env, iface_name, 0);
	
	ret = create_ushare(sz_iface_name/*, "2", "3"*/);
	
	(*env)->ReleaseStringUTFChars(env, iface_name, sz_iface_name);
	
	return ret;
}

jint
Java_com_willren_usharejni_UshareJni_stopServer ( JNIEnv* env,
                                                  jobject thiz )
{
	destroy_ushare();
	return 0;
}
